#define _CRT_SECURE_NO_WARNINGS 1

#include <stdio.h>
#include <assert.h>

int my_memcmp(const void* ptr1, const void* ptr2, size_t num)
{
	assert(ptr1 && ptr2);
	while (num--)
	{
		if (*(char*)ptr1 == *(char*)ptr2)
		{
			((char*)ptr1)++;
			((char*)ptr2)++;
		}
		else
			return (*(char*)ptr1 - *(char*)ptr2);
	}
	return 0;
}

int main()
{
	
		char arr1[] = "abad";
		char arr2[] = "abc";
		int ret = my_memcmp(arr1, arr2, 4);
		if (ret > 0)
			printf(">\n");
		else if (ret < 0)
			printf("<\n");
		else
			printf("==\n");
		return 0;
}